package net.lab1024.sa.admin.module.business.tests.dao;

import java.util.List;

import net.lab1024.sa.admin.module.business.tests.domain.entity.TestsEntity;
import net.lab1024.sa.admin.module.business.tests.domain.form.TestsQueryForm;
import net.lab1024.sa.admin.module.business.tests.domain.vo.TestsVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.lab1024.sa.admin.module.system.datascope.DataScope;
import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeTypeEnum;
import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeWhereInTypeEnum;
import net.lab1024.sa.admin.module.system.datascope.service.DataScopeCustomService;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

/**
 * cc Dao
 *
 * @Author zh
 * @Date 2024-08-20 16:01:05
 * @Copyright zz
 */

@Mapper
@Component
public interface TestsDao extends BaseMapper<TestsEntity> {

    /**
     * 分页 查询
     *
     * @param page
     * @param queryForm
     * @return
     */
//    @DataScope(dataScopeType = DataScopeTypeEnum.TESTS,whereInType = DataScopeWhereInTypeEnum.EMPLOYEE,joinSql = "user_id in (#employeeIds)")
//    @DataScope(dataScopeType = DataScopeTypeEnum.TESTS,whereInType = DataScopeWhereInTypeEnum.DEPARTMENT,joinSql = "dept_id in (#departmentIds)")
    @DataScope(dataScopeType = DataScopeTypeEnum.TESTS, whereInType = DataScopeWhereInTypeEnum.CUSTOM_STRATEGY, joinSqlImplClazz = DataScopeCustomService.class, paramName = "{dept:dept_id,user:user_id}")
    List<TestsVO> queryPage(Page page, @Param("queryForm") TestsQueryForm queryForm);


}
